%@brief Read topology from the file 
%@param [in] fn : Topology file name;
%@return topo : Topology, the user id is translate into position in array
%cell.



function retopo=read_audience_file2(fn)
fid=fopen(fn);
id2pos=containers.Map('KeyType','double','ValueType','Double');
pos2id=[];
pos=1;
while ~feof(fid)
    line=fgetl(fid);
    tmp = str2num(line);
    pos2id=[pos2id, tmp(1)];
    id2pos(tmp(1))=pos;
    if length(tmp)>1
        retopo{pos}=tmp(2:length(tmp));
    else
        retopo{pos}=[];
    end
    pos=pos+1;
end
for i = 1:(pos-1)
    if isempty(retopo{i})==true
        continue;
    else
        l=length(retopo{i});
        for j=1:l
            uid=retopo{i}(j);
            pos=id2pos(uid);
            retopo{i}(j)=pos;            
        end        
    end        
end

end
